Package-level declarations

Types

Link copied to clipboard
typealias MenuContent = @Composable MenuScope.() -> Unit

The content for a new menu, typically this should draw a single Menu.

Link copied to clipboard
interface MenuScope

Scope for the contents of a Menu.

Link copied to clipboard
interface Player

A player holding a THEOplayer instance that can be hosted by a DefaultUI or UIController.

Link copied to clipboard

The type of a stream.

Link copied to clipboard

Represents one or more ranges of time, each specified by a start time and an end time.

Link copied to clipboard

Scope for the contents of a UIController.

Functions

Link copied to clipboard
fun AudioTrackList(modifier: Modifier = Modifier, onClick: () -> Unit? = null)

A list of audio tracks, from which the user can choose an active audio track.

Link copied to clipboard

A Menu to change the spoken language of the stream.

Link copied to clipboard
fun ChromecastButton(modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), availableIcon: @Composable () -> Unit = { Icon( Icons.Rounded.Cast, contentDescription = "Start casting" ) }, connectingIcon: @Composable () -> Unit = { Icon( Icons.Rounded.Cast, contentDescription = "Stop casting" ) }, connectedIcon: @Composable () -> Unit = { Icon( Icons.Rounded.CastConnected, contentDescription = "Stop casting" ) })

A button to start and stop casting using Chromecast.

Link copied to clipboard
fun ChromecastDisplay(modifier: Modifier = Modifier)

A display for the state of an active Chromecast session.

Link copied to clipboard
fun ChromecastDisplayCompact(modifier: Modifier = Modifier)

A compact display for the state of an active Chromecast session.

Link copied to clipboard

An expanded display for the state of an active Chromecast session.

Link copied to clipboard
fun CurrentTimeDisplay(modifier: Modifier = Modifier, showRemaining: Boolean = false, showDuration: Boolean = false)

A text display that shows the player's current time.

Link copied to clipboard
fun DefaultUI(modifier: Modifier = Modifier, player: Player = rememberPlayer(), title: String? = null)
fun DefaultUI(modifier: Modifier = Modifier, config: THEOplayerConfig, source: SourceDescription? = null, title: String? = null)

A default THEOplayer UI component.

Link copied to clipboard
fun DurationDisplay(modifier: Modifier = Modifier)

A text display that shows the player's duration.

Link copied to clipboard
fun ErrorDisplay(modifier: Modifier = Modifier)

A display for a fatal error, if the player encounters one.

Link copied to clipboard
fun formatTime(time: Double, guide: Double = 0.0, preferNegative: Boolean = false): String

Return the given time in a human-readable format, such as "0:10" or "01:23:45".

Link copied to clipboard
fun formatTrackLabel(track: Track): String

Return a human-readable label for the given media track or text track.

Link copied to clipboard
fun FullscreenButton(modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), enter: @Composable () -> Unit = { Icon( Icons.Rounded.Fullscreen, contentDescription = "Enter fullscreen" ) }, exit: @Composable () -> Unit = { Icon( Icons.Rounded.FullscreenExit, contentDescription = "Exit fullscreen" ) })

A button that toggles fullscreen.

Link copied to clipboard
fun IconButton(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, colors: IconButtonColors = IconButtonDefaults.iconButtonColors(), contentPadding: PaddingValues = PaddingValues(0.dp), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, content: @Composable () -> Unit)
Link copied to clipboard

A Menu to change the spoken language and subtitles of the stream.

Link copied to clipboard
fun MenuScope.LanguageMenuButton(modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), content: @Composable () -> Unit = { Icon( painter = painterResource(id = R.drawable.language), contentDescription = "Language" ) })

A button that opens the language menu.

Link copied to clipboard

The compact menu contents of the LanguageMenu.

Link copied to clipboard

The expanded menu contents of the LanguageMenu.

Link copied to clipboard
fun LiveButton(modifier: Modifier = Modifier, contentPadding: PaddingValues = ButtonDefaults.TextButtonContentPadding, colors: IconButtonColors = IconButtonDefaults.iconButtonColors(), liveThreshold: Double = 10.0, live: @Composable RowScope.() -> Unit = { Icon( Icons.Rounded.Circle, modifier = Modifier.size(12.dp), tint = THEOplayerTheme.playerColors.liveButtonLive, contentDescription = null ) Text(text = " LIVE") }, dvr: @Composable RowScope.() -> Unit = { Icon( Icons.Rounded.Circle, modifier = Modifier.size(12.dp), tint = THEOplayerTheme.playerColors.liveButtonDvr, contentDescription = null ) Text(text = " LIVE") })

A button that shows whether the player is currently playing at the live point, and seeks to the live point when clicked.

Link copied to clipboard
fun LoadingSpinner(modifier: Modifier = Modifier, color: Color = ProgressIndicatorDefaults.circularColor, strokeWidth: Dp = ProgressIndicatorDefaults.CircularStrokeWidth, delay: Duration = THEOplayerTheme.playerAnimations.loadingSpinnerDelay)

An indicator that shows whether the player is currently waiting for more data to resume playback.

Link copied to clipboard
fun MenuScope.Menu(modifier: Modifier = Modifier, title: @Composable () -> Unit, backIcon: @Composable () -> Unit = { Icon( Icons.AutoMirrored.Rounded.ArrowBack, contentDescription = "Back" ) }, content: @Composable () -> Unit)

A menu that can be opened on top of the player.

Link copied to clipboard
fun MuteButton(modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), mute: @Composable () -> Unit = { Icon( Icons.AutoMirrored.Rounded.VolumeUp, contentDescription = "Mute" ) }, unmute: @Composable () -> Unit = { Icon( Icons.AutoMirrored.Rounded.VolumeOff, contentDescription = "Unmute" ) })

A button that toggles whether audio is muted or not.

Link copied to clipboard
fun PlaybackRateList(modifier: Modifier = Modifier, playbackRates: List<Double> = listOf(0.25, 0.5, 1.0, 1.25, 1.5, 2.0), onClick: () -> Unit? = null)

A list of playback rates, from which the user can choose a desired playback rate.

Link copied to clipboard

A Menu to change the playback rate of the player.

Link copied to clipboard
fun PlayButton(modifier: Modifier = Modifier, iconModifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), play: @Composable () -> Unit = { Icon( painter = painterResource(id = R.drawable.play), modifier = iconModifier, contentDescription = "Play" ) }, pause: @Composable () -> Unit = { Icon( painter = painterResource(id = R.drawable.pause), modifier = iconModifier, contentDescription = "Pause" ) }, replay: @Composable () -> Unit = { Icon( Icons.Rounded.Replay, modifier = iconModifier, contentDescription = "Replay" ) })

A button that toggles whether the player is playing or paused.

Link copied to clipboard
fun QualityList(modifier: Modifier = Modifier, onClick: () -> Unit? = null)

A list of video qualities, from which the user can choose a target video quality.

Link copied to clipboard

A Menu to change the video quality of the stream.

Link copied to clipboard
fun rememberPlayer(config: THEOplayerConfig? = null): Player

Creates and remembers a Player.

fun rememberPlayer(theoplayerView: THEOplayerView): Player

Create a Player wrapping an existing THEOplayerView.

Link copied to clipboard
fun SeekBar(modifier: Modifier = Modifier, colors: SliderColors = SliderDefaults.colors())

A seek bar showing the current time of the player, and which seeks the player when clicked or dragged.

Link copied to clipboard
fun SeekButton(modifier: Modifier = Modifier, seekOffset: Int = 10, contentPadding: PaddingValues = PaddingValues(0.dp), content: @Composable () -> Unit)
fun SeekButton(modifier: Modifier = Modifier, seekOffset: Int = 10, iconSize: Dp = 24.dp, contentPadding: PaddingValues = PaddingValues(0.dp))

A button that seeks forward or backward by a fixed offset.

Link copied to clipboard

A Menu to change the settings of the player, such as the video quality or the playback rate.

Link copied to clipboard
fun MenuScope.SettingsMenuButton(modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), content: @Composable () -> Unit = { Icon( Icons.Rounded.Settings, contentDescription = "Settings" ) })

A button that opens the settings menu.

Link copied to clipboard

A Menu to change the subtitles of the stream.

Link copied to clipboard
fun SubtitleTrackList(modifier: Modifier = Modifier, onClick: () -> Unit? = null)

A list of subtitle tracks, from which the user can choose an active subtitle track.

Link copied to clipboard
fun UIController(modifier: Modifier = Modifier, player: Player = rememberPlayer(), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, color: Color = Color.Black, centerOverlay: @Composable UIControllerScope.() -> Unit? = null, errorOverlay: @Composable UIControllerScope.() -> Unit? = null, topChrome: @Composable UIControllerScope.() -> Unit? = null, centerChrome: @Composable UIControllerScope.() -> Unit? = null, bottomChrome: @Composable UIControllerScope.() -> Unit? = null)
fun UIController(modifier: Modifier = Modifier, config: THEOplayerConfig, source: SourceDescription? = null, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, color: Color = Color.Black, centerOverlay: @Composable UIControllerScope.() -> Unit? = null, errorOverlay: @Composable UIControllerScope.() -> Unit? = null, topChrome: @Composable UIControllerScope.() -> Unit? = null, centerChrome: @Composable UIControllerScope.() -> Unit? = null, bottomChrome: @Composable UIControllerScope.() -> Unit? = null)

A container component for a THEOplayer UI.